package meiriyiti

func divideString(s string, k int, fill byte) []string {
	b := []byte(s)
	ans := make([]string, 0)
	for i := 0; i < len(b); i += k {
		if len(b)-i >= k {
			ans = append(ans, string(b[i:i+k]))
		} else {
			ans = append(ans, string(b[i:]))
		}
	}
	y := k - len(ans[len(ans)-1])
	ys := []byte(ans[len(ans)-1])
	for i := 0; i < y; i++ {
		ys = append(ys, fill)
	}
	ans[len(ans)-1] = string(ys)
	return ans
}
